package main

import (
	"fmt"
	"sort"
)

func main() {
	//ages := make(map[string]int)

	ages := map[string]int{
		"Charlie": 30,
		"Alice":   25,
		"Bob":     15,
	}

	for name, age := range ages {
		fmt.Printf("%s: %d\n", name, age)
	}

	var names []string
	for name := range ages {
		names = append(names, name)
	}
	sort.Strings(names)
	for _, name := range names {
		fmt.Printf("%s: %d\n", name, ages[name])
	}
}
